/**
 * Created by zhoulin on 2019/3/29.
 */

//dev :开发环境，prod:生产环境，test:测试环境
//var _ENV = "dev";

//权限编码herader名称
var _PERM_CODING_HEADER_VALUE = "permCoding";
var _TOKEN_HEADER_VALUE = "Authorization";
var _LOGIN_TIMEOUT_CODE = 5000; //系统登录超时code值

var _LOGIN_PAGE = "";
var _DEV_LOGIN_PAGE = "http://localhost:63342/html-root/education-root/admin/login.html";
var _PROD_LOGIN_PAGE = "http://manage.wanxuehui.com/html-root/education-root/admin/login.html";
var _TEST_LOGIN_PAGE = "http://test.wanxuehui.com/html-root/education-root/admin/login.html";

//请求主机配置
//请求主机配置
var _HOST = ""; //服务请求
var _DEV_HOST = "http://127.0.0.1";
// var _DEV_HOST = "https://www.boxuejia.com";
var _PROD_HOST = "https://www.boxuejia.com";
var _TEST_HOST = "http://test.boxuejia.com";

// 代理配置
var _PROXY = {}
var _DEV_PROXY = {
    activity_articles_service:":8084/activeArticlesService",
    admin_service:":8081/adminService",
    business_manage_service:":8082/businessManageService",
    common_service:":8083/commonService",
    organization_service:":8088/organizationService",
    marketing_service:":8090/marketingService",
    wechat_service:":8087/wechatService",
    learning_service:":8089/learningService",
    user_center_service:":8086/userCenterService",
}
/*var _DEV_PROXY = {
    activity_articles_service:"/activeArticlesService",
    admin_service:"/adminService",
    business_manage_service:"/businessManageService",
    common_service:"/commonService",
    organization_service:"/organizationService",
    marketing_service:"/marketingService",
    wechat_service:":/wechatService",
    learning_service:":/learningService",
    user_center_service:":/userCenterService",
}*/
var _PROD_PROXY = {
    activity_articles_service:"/activeArticlesService",
    admin_service:"/adminService",
    business_manage_service:"/businessManageService",
    common_service:"/commonService",
    organization_service:"/organizationService",
    marketing_service:"/marketingService",
    wechat_service:":/wechatService",
    learning_service:":/learningService",
    user_center_service:":/userCenterService",
}
var _TEST_PROXY = {
    activity_articles_service:"/activeArticlesService",
    admin_service:"/adminService",
    business_manage_service:"/businessManageService",
    common_service:"/commonService",
    organization_service:"/organizationService",
    marketing_service:"/marketingService",
    wechat_service:":/wechatService",
    learning_service:":/learningService",
    user_center_service:":/userCenterService",
}

if("dev" == _ENV){
    _HOST = _DEV_HOST;
    _PROXY = _DEV_PROXY;
    _LOGIN_PAGE = _DEV_LOGIN_PAGE;
}else if("prod" == _ENV){
    _HOST = _PROD_HOST;
    _PROXY = _PROD_PROXY;
    _LOGIN_PAGE = _PROD_LOGIN_PAGE;
}else {
    _HOST = _TEST_HOST;
    _PROXY = _TEST_PROXY;
    _LOGIN_PAGE = _TEST_LOGIN_PAGE;
}

//接口配置
var _API = {
    admin_index_doLogin:_PROXY.admin_service+"/api/index/doLogin",// 登录
    admin_index_loginOut:_PROXY.admin_service+"/api/index/loginOut",//GET /adminService/api/index/loginOut 退出登录
    admin_index_getInfoById:_PROXY.admin_service+"/api/index/getInfoById/",//GET /adminService/api/index/getInfoById/{id} 根据主键id查询
    admin_index_getMenu:_PROXY.admin_service+"/api/index/getMenu/",//GET /adminService/api/index/getMenu/{pid} 根据权限父级id查询权限目录
    admin_index_isOldPassword:_PROXY.admin_service+"/api/index/isOldPassword",//GET /adminService/api/index/isOldPassword 修改密码时候判断原始密码是否正确
    admin_index_updatePs:_PROXY.admin_service+"/api/index/updatePs",//POST /adminService/api/index/updatePs 修改密码
    admin_index_isUsername:_PROXY.admin_service+"/api/index/isUsername",//GET /adminService/api/index/isUsername 判断账号情况（是否禁用等等）

    admin_sysAdmin_list:_PROXY.admin_service+"/api/sysAdmin/list",//GET /adminService/api/sysAdmin/list 获取用户列表
    admin_sysAdmin_getUserInfo:_PROXY.admin_service+"/api/sysAdmin/getUserInfo",//GET /adminService/api/sysAdmin/getUserInfo 根据token查询一条账户基本数据
    admin_sysAdmin_add:_PROXY.admin_service+"/api/sysAdmin/add",//POST /adminService/api/sysAdmin/add 添加平台管理账号
    admin_sysAdmin_update:_PROXY.admin_service+"/api/sysAdmin/update",//PUT /adminService/api/sysAdmin/update 修改添加平台管理账号
    admin_sysAdmin_batchStatus:_PROXY.admin_service+"/api/sysAdmin/batchStatus",//PUT /adminService/api/sysAdmin/batchStatus 处理平台管理员账号状态，可批量（List）
    admin_sysAdmin_delete:_PROXY.admin_service+"/api/sysAdmin/delete/",//PUT /adminService/api/sysAdmin/delete/{ids} 根据角色ids删除角色 和 权限角色表数据
    admin_sysAdmin_getInfoById:_PROXY.admin_service+"/api/sysAdmin/getInfoById/",//GET /adminService/api/sysAdmin/getInfoById/{id} 根据主键id查询
    admin_sysAdmin_resetPS:_PROXY.admin_service+"/api/sysAdmin/resetPS",//PUT /adminService/api/sysAdmin/resetPS 重置平台管理员密码

    admin_sysPermission_list:_PROXY.admin_service+"/api/sysPermission/list/",//GET /adminService/api/sysPermission/list/{isOperator} 根据isOperator查询权限列表 是否运营商后台权限（0：否，1：是）
    admin_sysPermission_add:_PROXY.admin_service+"/api/sysPermission/add",//POST /adminService/api/sysPermission/add 添加权限
    admin_sysPermission_update:_PROXY.admin_service+"/api/sysPermission/update",//PUT /adminService/api/sysPermission/update 修改权限
    admin_sysPermission_delete:_PROXY.admin_service+"/api/sysPermission/delete/",//PUT /adminService/api/sysPermission/delete{id} 根据权限id删除权限 和 权限角色表数据
    admin_sysPermission_getInfoById:_PROXY.admin_service+"/api/sysPermission/getInfoById/",//GET /adminService/api/sysPermission/getInfoById/{id} 根据主键id查询
    admin_sysPermission_getPermissionZTreeNodes:_PROXY.admin_service+"/api/sysPermission/getPermissionZTreeNodes/",//GET /adminService/api/sysPermission/getPermissionZTreeNodes/{roleId}/{isOperator} 查询权限树形展示（roleId不传表示查全部） 并且选中角色拥有的树节点
    admin_sysPermission_getTypePermission:_PROXY.admin_service+"/api/sysPermission/getTypePermission/",//GET /adminService/api/sysPermission/getTypePermission/{type}/{isOperator} 根据当前权限类别type 获取父级select
    admin_sysPermission_modifyRolePermission:_PROXY.admin_service+"/api/sysPermission/modifyRolePermission",//PUT /adminService/api/sysPermission/modifyRolePermission 分配角色权限
    admin_sysPermission_modifyBRolePermission:_PROXY.admin_service+"/api/sysPermission/modifyBRolePermission",//PUT /adminService/api/sysPermission/modifyRolePermission 分配角色权限

    admin_sysRole_list:_PROXY.admin_service+"/api/sysRole/list",//GET /adminService/api/sysRole/list 获取角色列表
    admin_sysRole_add:_PROXY.admin_service+"/api/sysRole/add",//POST /adminService/api/sysRole/add 添加角色
    admin_sysRole_update:_PROXY.admin_service+"/api/sysRole/update",//PUT /adminService/api/sysRole/update 修改角色
    admin_sysRole_delete:_PROXY.admin_service+"/api/sysRole/delete/",//PUT /adminService/api/sysRole/delete/{ids} 根据角色ids删除角色 和 权限角色表数据
    admin_sysRole_getInfoById:_PROXY.admin_service+"/api/sysRole/getInfoById/",//GET /adminService/api/sysRole/getInfoById/{id} 根据主键id查询
    admin_sysRole_getAllRole:_PROXY.admin_service+"/api/sysRole/getAllRole/",//GET /adminService/api/sysRole/getAllRole 查询平台管理员的角色
    admin_sysRole_getUserRole:_PROXY.admin_service+"/api/sysRole/getUserRole/",//GET /adminService/api/sysRole/getUserRole/{id} 查询平台管理员拥有的角色
    admin_sysRole_modifyUserRole:_PROXY.admin_service+"/api/sysRole/modifyUserRole",//PUT /adminService/api/sysRole/modifyUserRole 分配平台管理员角色

    admin_sysBusiness_list:_PROXY.admin_service+"/api/sysBusiness/list",//GET /adminService/api/sysAdmin/list 获取用户列表
    admin_sysBusiness_getUserInfo:_PROXY.admin_service+"/api/sysBusiness/getUserInfo",//GET /adminService/api/sysAdmin/getUserInfo 根据token查询一条账户基本数据
    admin_sysBusiness_add:_PROXY.admin_service+"/api/sysBusiness/add",//POST /adminService/api/sysAdmin/add 添加平台管理账号
    admin_sysBusiness_update:_PROXY.admin_service+"/api/sysBusiness/update",//PUT /adminService/api/sysAdmin/update 修改添加平台管理账号
    admin_sysBusiness_batchStatus:_PROXY.admin_service+"/api/sysBusiness/batchStatus",//PUT /adminService/api/sysAdmin/batchStatus 处理平台管理员账号状态，可批量（List）
    admin_sysBusiness_delete:_PROXY.admin_service+"/api/sysBusiness/delete/",//PUT /adminService/api/sysAdmin/delete/{ids} 根据角色ids删除角色 和 权限角色表数据
    admin_sysBusiness_getInfoById:_PROXY.admin_service+"/api/sysBusiness/getInfoById/",//GET /adminService/api/sysAdmin/getInfoById/{id} 根据主键id查询
    admin_sysBusiness_resetPS:_PROXY.admin_service+"/api/sysBusiness/resetPS",//PUT /adminService/api/sysAdmin/resetPS 重置平台管理员密码

    admin_sysBusinessRole_list:_PROXY.admin_service+"/api/sysBusinessRole/list",//GET /adminService/api/sysBusinessRole/list 获取角色列表
    admin_sysBusinessRole_copy:_PROXY.admin_service+"/api/sysBusinessRole/copy",//POST /adminService/api/sysBusinessRole/add 添加角色
    admin_sysBusinessRole_update:_PROXY.admin_service+"/api/sysBusinessRole/update",//PUT /adminService/api/sysBusinessRole/update 修改角色
    admin_sysBusinessRole_delete:_PROXY.admin_service+"/api/sysBusinessRole/delete/",//PUT /adminService/api/sysBusinessRole/delete/{ids} 根据角色ids删除角色 和 权限角色表数据
    admin_sysBusinessRole_getInfoById:_PROXY.admin_service+"/api/sysBusinessRole/getInfoById/",//GET /adminService/api/sysBusinessRole/getInfoById/{id} 根据主键id查询
    admin_sysBusinessRole_getAllRole:_PROXY.admin_service+"/api/sysBusinessRole/getAllRole/",//GET /adminService/api/sysBusinessRole/getAllRole/{cid} 查询平台管理员的角色
    admin_sysBusinessRole_getUserRole:_PROXY.admin_service+"/api/sysBusinessRole/getUserRole/",//GET /adminService/api/sysBusinessRole/getUserRole/{id} 查询平台管理员拥有的角色
    admin_sysBusinessRole_modifyUserRole:_PROXY.admin_service+"/api/sysBusinessRole/modifyUserRole",//PUT /adminService/api/sysBusinessRole/modifyUserRole 分配平台管理员角色

    /**
     * 活动文章服务
     */

    /**
     * 公共服务
     */
    common_loginlog_list:_PROXY.common_service+"/api/loginLog/list",
    common_modellog_list:_PROXY.common_service+"/api/modalLog/list",

    common_file_ossUpload:_PROXY.common_service+"/api/file/ossUpload",

    common_dic_list:_PROXY.common_service+"/api/sysDictionary/list",
    common_dic_add:_PROXY.common_service+"/api/sysDictionary/add",
    common_dic_update:_PROXY.common_service+"/api/sysDictionary/update",
    common_dic_delete:_PROXY.common_service+"/api/sysDictionary/delete",
    common_dic_getById:_PROXY.common_service+"/api/sysDictionary/getById",
    common_dic_dicList:_PROXY.common_service+"/api/sysDictionary/dicList",

    common_banner_list:_PROXY.common_service+"/api/banner/list",
    common_banner_add:_PROXY.common_service+"/api/banner/add",
    common_banner_update:_PROXY.common_service+"/api/banner/update",
    common_banner_delete:_PROXY.common_service+"/api/banner/delete",
    common_banner_getById:_PROXY.common_service+"/api/banner/getById",


    common_tag_list:_PROXY.common_service+"/api/tag/list",
    common_tag_add:_PROXY.common_service+"/api/tag/add",
    common_tag_update:_PROXY.common_service+"/api/tag/update",
    common_tag_delete:_PROXY.common_service+"/api/tag/delete",
    common_tag_getById:_PROXY.common_service+"/api/tag/getById",
    common_tag_getTagsByType:_PROXY.common_service+"/api/tag/getTagsByType",

    business_companyApply_list:_PROXY.business_manage_service+"/api/companyApply/list",
    business_companyApply_add:_PROXY.business_manage_service+"/api/companyApply/add",
    business_companyApply_update:_PROXY.business_manage_service+"/api/companyApply/update",
    business_companyApply_delete:_PROXY.business_manage_service+"/api/companyApply/delete",
    business_companyApply_getById:_PROXY.business_manage_service+"/api/companyApply/getById",
    business_companyApply_getInfoById:_PROXY.business_manage_service+"/api/companyApply/getInfoById/",
    business_companyApply_deal:_PROXY.business_manage_service+"/api/companyApply/deal",

    business_company_list:_PROXY.business_manage_service+"/api/company/list",
    business_company_update:_PROXY.business_manage_service+"/api/company/update",
    business_company_getById:_PROXY.business_manage_service+"/api/company/getById",

    business_companyZktecoInfo_listByPage:_PROXY.business_manage_service+"/api/companyZktecoInfo/listByPage",
    business_companyZktecoInfo_getInfoById:_PROXY.business_manage_service+"/api/companyZktecoInfo/getInfoById/",
    business_companyZktecoInfo_add:_PROXY.business_manage_service+"/api/companyZktecoInfo/add",
    business_companyZktecoInfo_update:_PROXY.business_manage_service+"/api/companyZktecoInfo/update",
    business_companyZktecoInfo_delete:_PROXY.business_manage_service+"/api/companyZktecoInfo/delete",

    business_app_list:_PROXY.business_manage_service+"/api/app/list",
    business_app_add:_PROXY.business_manage_service+"/api/app/add",
    business_app_update:_PROXY.business_manage_service+"/api/app/update",
    business_app_delete:_PROXY.business_manage_service+"/api/app/delete",
    business_app_getById:_PROXY.business_manage_service+"/api/app/getById",
    business_app_checkExpiresToken:_PROXY.business_manage_service+"/api/app/checkExpiresToken",
    business_app_updateMiniAccessToken:_PROXY.business_manage_service+"/api/app/updateMiniAccessToken",
    business_app_clearApiQuota:_PROXY.business_manage_service+"/api/app/clearApiQuota",

    business_appPermission_list:_PROXY.business_manage_service+"/api/appPermission/list",
    business_appPermission_add:_PROXY.business_manage_service+"/api/appPermission/add",
    business_appPermission_update:_PROXY.business_manage_service+"/api/appPermission/update",
    business_appPermission_delete:_PROXY.business_manage_service+"/api/appPermission/delete",
    business_appPermission_getById:_PROXY.business_manage_service+"/api/appPermission/getById",
    business_appPermission_getTypePermission:_PROXY.business_manage_service+"/api/appPermission/getTypePermission",
    business_appPermission_getPermissionZTreeNodes:_PROXY.business_manage_service+"/api/appPermission/getPermissionZTreeNodes",
    business_appPermission_modifyCompanyPermission:_PROXY.business_manage_service+"/api/appPermission/modifyCompanyPermission",
    business_appPermission_getServiceVersionTypePermissionZTreeNodes:_PROXY.business_manage_service+"/api/appPermission/getServiceVersionTypePermissionZTreeNodes/",
    business_appPermission_modifyServiceVersionTypePermission:_PROXY.business_manage_service+"/api/appPermission/modifyServiceVersionTypePermission",

    business_sysPermission_getCompanyPermissionZTreeNodes:_PROXY.business_manage_service+"/api/sysPermission/getCompanyPermissionZTreeNodes/",//getCompanyPermissionZTreeNodes/{companyId}
    business_sysPermission_modifyCompanyPermission:_PROXY.business_manage_service+"/api/sysPermission/modifyCompanyPermission",
    business_sysPermission_getServiceVersionTypePermissionZTreeNodes:_PROXY.business_manage_service+"/api/sysPermission/getServiceVersionTypePermissionZTreeNodes/",//getCompanyPermissionZTreeNodes/{companyId}
    business_sysPermission_modifyServiceVersionTypePermission:_PROXY.business_manage_service+"/api/sysPermission/modifyServiceVersionTypePermission",

    business_serviceVersionType_getInfoById:_PROXY.business_manage_service+"/api/serviceVersionType/getInfoById/",
    business_serviceVersionType_listAll:_PROXY.business_manage_service+"/api/serviceVersionType/listAll",
    business_serviceVersionType_list:_PROXY.business_manage_service+"/api/serviceVersionType/list",
    business_serviceVersionType_add:_PROXY.business_manage_service+"/api/serviceVersionType/add",
    business_serviceVersionType_update:_PROXY.business_manage_service+"/api/serviceVersionType/update",
    business_serviceVersionType_delete:_PROXY.business_manage_service+"/api/serviceVersionType/delete",
    business_serviceVersionType_modifyCompanyServiceVersionType:_PROXY.business_manage_service+"/api/serviceVersionType/modifyCompanyServiceVersionType",

    business_package_list:_PROXY.business_manage_service+"/api/package/list",
    business_package_add:_PROXY.business_manage_service+"/api/package/add",
    business_package_update:_PROXY.business_manage_service+"/api/package/update",
    business_package_delete:_PROXY.business_manage_service+"/api/package/delete",
    business_package_getById:_PROXY.business_manage_service+"/api/package/getById",

    business_packageSalesRecord_list:_PROXY.business_manage_service+"/api/packageSalesRecord/list",
    business_packageSalesRecord_add:_PROXY.business_manage_service+"/api/packageSalesRecord/add",
    business_packageSalesRecord_update:_PROXY.business_manage_service+"/api/packageSalesRecord/update",
    business_packageSalesRecord_delete:_PROXY.business_manage_service+"/api/packageSalesRecord/delete",
    business_packageSalesRecord_getById:_PROXY.business_manage_service+"/api/packageSalesRecord/getById",
    business_packageSalesRecord_updateDeal:_PROXY.business_manage_service+"/api/packageSalesRecord/updateDeal",
    business_packageSalesRecord_detail:_PROXY.business_manage_service+"/api/packageSalesRecord/detail",

    wechat_wxTemplate_list:_PROXY.wechat_service+"/api/wxTemplate/list",
    wechat_wxTemplate_add:_PROXY.wechat_service+"/api/wxTemplate/add",
    wechat_wxTemplate_update:_PROXY.wechat_service+"/api/wxTemplate/update",
    wechat_wxTemplate_delete:_PROXY.wechat_service+"/api/wxTemplate/delete",
    wechat_wxTemplate_getById:_PROXY.wechat_service+"/api/wxTemplate/getById",

    wechat_ewxApp_list:_PROXY.wechat_service+"/api/ewxApp/list",
    wechat_ewxApp_add:_PROXY.wechat_service+"/api/ewxApp/add",
    wechat_ewxApp_update:_PROXY.wechat_service+"/api/ewxApp/update",
    wechat_ewxApp_delete:_PROXY.wechat_service+"/api/ewxApp/delete",
    wechat_ewxApp_getById:_PROXY.wechat_service+"/api/ewxApp/getById",

    learning_medalTemplate_list:_PROXY.learning_service+"/api/medalTemplate/list",
    learning_medalTemplate_add:_PROXY.learning_service+"/api/medalTemplate/add",
    learning_medalTemplate_update:_PROXY.learning_service+"/api/medalTemplate/update",
    learning_medalTemplate_delete:_PROXY.learning_service+"/api/medalTemplate/delete",
    learning_medalTemplate_getById:_PROXY.learning_service+"/api/medalTemplate/getById",

    business_posterTemplate_list:_PROXY.business_manage_service+"/api/posterTemplate/list",
    business_posterTemplate_add:_PROXY.business_manage_service+"/api/posterTemplate/add",
    business_posterTemplate_update:_PROXY.business_manage_service+"/api/posterTemplate/update",
    business_posterTemplate_delete:_PROXY.business_manage_service+"/api/posterTemplate/delete",
    business_posterTemplate_getById:_PROXY.business_manage_service+"/api/posterTemplate/getById",
    business_posterTemplate_active:_PROXY.business_manage_service+"/api/posterTemplate/active",

    userCenter_group_list:_PROXY.user_center_service+"/api/group/list",
    userCenter_group_add:_PROXY.user_center_service+"/api/group/add",
    userCenter_group_update:_PROXY.user_center_service+"/api/group/update",
    userCenter_group_delete:_PROXY.user_center_service+"/api/group/delete",
    userCenter_group_getById:_PROXY.user_center_service+"/api/group/getById",

    userCenter_groupRelation_list:_PROXY.user_center_service+"/api/groupRelation/list",
    userCenter_groupRelation_add:_PROXY.user_center_service+"/api/groupRelation/add",
    userCenter_groupRelation_update:_PROXY.user_center_service+"/api/groupRelation/update",
    userCenter_groupRelation_delete:_PROXY.user_center_service+"/api/groupRelation/delete",
    userCenter_groupRelation_getById:_PROXY.user_center_service+"/api/groupRelation/getById",

    organization_vote_list:_PROXY.organization_service+"/api/vote/list",
    organization_vote_add:_PROXY.organization_service+"/api/vote/add",
    organization_vote_update:_PROXY.organization_service+"/api/vote/update",
    organization_vote_delete:_PROXY.organization_service+"/api/vote/delete",
    organization_vote_getById:_PROXY.organization_service+"/api/vote/getById",

    organization_voteRecords_list:_PROXY.organization_service+"/api/voteRecords/list",
    organization_voteRecords_add:_PROXY.organization_service+"/api/voteRecords/add",
    organization_voteRecords_update:_PROXY.organization_service+"/api/voteRecords/update",
    organization_voteRecords_delete:_PROXY.organization_service+"/api/voteRecords/delete",
    organization_voteRecords_getById:_PROXY.organization_service+"/api/voteRecords/getById",
    organization_voteRecords_status:_PROXY.organization_service+"/api/voteRecords/status",

};

_PERMISSIONS=sessionStorageUtils.getJson(storageKey.sessionStorageKey.permCodes)//设置权限
